Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue550 add equalable content provider #766

Conversation

from-unknown
Copy link
Contributor

@jmatsu-bot
Copy link
Collaborator

@from-unknown
Copy link
Contributor Author

Actually, this PR is still having a little issue, which is that if you type "team", some speakers name "t" still highlighted.
I would like to ask that make new issue or keep fixing.


import java.util.Arrays

interface EqualableContentsProvider {
Copy link
Member

@takahirom takahirom Feb 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this interface to androidcomponent module? for sharing 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, item folder would be good?

if (speaker != other.speaker) return false
if (query != other.query) return false
override fun isTextHighlightNeedUpdate() = query?.let {
speaker.name.toLowerCase().contains(it.toLowerCase().toRegex())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this toRegex() is not good 🙇‍♂️
Type + crashes app, I will fix it.

@from-unknown
Copy link
Contributor Author

from-unknown commented Feb 3, 2019

I fixed a small issue which I mentioned, so I will push it.

check old text highlight to update item which unnecessary highlighted
remove toRegex() because it crushes when '+' is passed
@jmatsu-bot
Copy link
Collaborator

Apk comparision results

Property Summary
New File Size 8367748 Bytes. (7.98 MB)
File Size Change +296 Bytes. (+0.29 KB)
Download Size Change +1168 Bytes. (+1.14 KB)
New Method Reference Count 61453
Method Reference Count Change 127
New Number of dex file(s) 1
Number of dex file(s) Change 0
Removed Required Features - android.hardware.wifi (requested android.permission.ACCESS_WIFI_STATE permission, and requested android.permission.CHANGE_WIFI_STATE permission)
Removed Permissions - android.permission.CHANGE_WIFI_STATE
- android.permission.ACCESS_WIFI_STATE

Generated by 🚫 Danger

@jmatsu-bot
Copy link
Collaborator

Asserted successfully. 💯

Generated by 🚫 Danger


if (speaker != other.speaker) return false
if (query != other.query) return false
override fun isTextHighlightNeedUpdate() = query?.let {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょっと日本語で失礼します。 🙇
isTextHighlightNeedUpdateだと問題があるかもしれません。なぜなら例えばandroidとか入れている時に、1つのセッションをfavoriteするとマッチしている他のセッションも全て点滅してしまいます。
個人的にはproviderEqualableContentsでヒットしているときのみqueryを入れるのがバグがなくて一番良いと思っていますがどうでしょうか?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません、最初にissueでコメントして頂いた意図を汲みきれていなかったみたいですね。
providerEqualableContentsにqueryを含めることでequalにならない様にする、というところまで読み切れていませんでした。
確かにチェックする箇所を1箇所にまとめる方がバグの混入が防げて良さそうですね。
修正されたコードで軽く動作確認しましたが、入力や削除時の動作で特に気になる点はなかったので問題ないかと思います 🙇‍♂️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます! 🙇

takahirom added a commit that referenced this pull request Feb 3, 2019
…e_content_provider

[Based on #766] add equalable content provider
@takahirom
Copy link
Member

Merged 🙇
https://github.com/DroidKaigi/conference-app-2019/commits?author=from-unknown

@takahirom takahirom closed this Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add EqualableContentsProvider for SearchFragment
3 participants